using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class mg_configMap : EntityTypeConfiguration<mg_config>
    {
        public mg_configMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Default_Physicians_AP_ACCT, t.Default_Patient_AR_ACCT });

            // Properties
            this.Property(t => t.Default_Physicians_GL_ACCT)
                .HasMaxLength(40);

            this.Property(t => t.Default_Physicians_AP_ACCT)
                .IsRequired()
                .HasMaxLength(13);

            this.Property(t => t.Default_Patient_GL_ACCT)
                .HasMaxLength(40);

            this.Property(t => t.Default_Patient_AR_ACCT)
                .IsRequired()
                .HasMaxLength(13);

            this.Property(t => t.Default_Dental_Item)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("mg_config");
            this.Property(t => t.Default_Physicians_GL_ACCT).HasColumnName("Default_Physicians_GL_ACCT");
            this.Property(t => t.Default_Physicians_AP_ACCT).HasColumnName("Default_Physicians_AP_ACCT");
            this.Property(t => t.Default_Patient_GL_ACCT).HasColumnName("Default_Patient_GL_ACCT");
            this.Property(t => t.Default_Patient_AR_ACCT).HasColumnName("Default_Patient_AR_ACCT");
            this.Property(t => t.Default_Dental_Item).HasColumnName("Default_Dental_Item");
        }
    }
}
